import {callAjax} from '@/util/ajax/index.js'

export let _User = {
	getUserInfo : function(userInfo,resolve,reject){
		callAjax({
			url     : '/user/login.do',
            data    : userInfo,
            success : resolve,
            error   : reject 
		})
	},
	register : function(userInfo,resolve,reject){
		callAjax({
			url     : '/user/register.do',
			data    : userInfo,
			success : resolve,
			error   : reject
		})
	},
	checkLogin : function(resolve,reject){
		callAjax({
			url     : '/user/get_user_info.do',
            success : resolve,
            error   : reject
		})
	},
	checkUsername : function(username, resolve, reject){
        callAjax({
            url     : '/user/check_valid.do',
            data    : {
                
                str    : username,
                type   : 'username',
            },
            
            success : resolve,
            error   : reject
        });
    },
}
